<!--查询订单-->
<h3>根据条件进行相应的订单查询</h3>
<div id="order_search">
<form action="/admin/order/do_search" method="post" id="order_search_form">
	 <div class="span-8 cell">
		 <p>
		 <h3>订单发生的时间段</h3>
		 <label for="from">从</label>
		 <input type="text" id="from" name="order_time_from" class="text"/><br />
		 <label for="to">到</label>
		 <input type="text" id="to" name="order_time_to" class="text"/>
		 </p>
	 </div>
	 <div class="span-8 cell">
		 <p>
		 <h3>商品相关关键字</h3>
		 <p>
		 <label for="prodct_cond"></label>
		 <select id="" name="product_cond">
		 	<option value="product_id">编号</option>
		 	<option value="title">标题</option>
		 	<option value="describe">内容</option>
		 </select>
		 <input type="text" class="text" name="product_cond_value" id="product_cond_value" /> 
		 <hr />
		 <p>
		 <h3>商品单价范围</h3>
		 <label for="product_price_from">从</label>
		 <input type="text" id="product_price_from" name="product_price_from" class="text"/><br />
		 <label for="product_price_to">到</label>
		 <input type="text" id="product_price_to" name="product_price_to" class="text"/>
		 </p>
		 </p>
	 </div>
	 <div class="span-8 cell">
		 <p>
		 <h3>服务相关关键字</h3>
		 <label for="product_class_cond"></label>
		 <select id="product_class_cond" name="product_class_cond">
		 	<option value="product_class_name_cn">服务名称</option>
		 </select>
 	 	 <input type="text" class="text" name="product_class_cond_value" id="product_class_cond_value" /> 
		 </p>
	 </div>
	 <div class="span-8 cell">
		 <p>
		 <h3>交易关键字</h3>
		 <p>
		 <label for="order_cond"></label>
		 <select id="order_cond" name="order_cond">
			<option value="order_sn">订单编号</option>
			<option value="address">收件人地址</option>
		 </select>
		 <input type="text" class="text" name="order_cond_value" id="order_cond_value" /> 
		 <div class="address_value">
			 <label for="city" class="spc"></label>
		 	 <select id="loc_province"  name="province" class="text input city"></select>
		 	 <input name="loc_province" type="hidden" />

		 	 <select id="loc_city" style="width:100px;" name="city" class="input text"></select>
		 	 <input name="loc_city" type="hidden" />

		 	 <select id="loc_town" style="width:122px;" name="town" class="input text"></select>
			 <input name="loc_town" type="hidden" />

			 <label for="address_detail">街道地址：</label>
			 <input type="text" name="address_detail" class="text"/>

			 <label for="zip">邮编：</label>
			 <input type="text" name="zip" class="text"/>

			 <label for="name">收货人姓名：</label>
			 <input type="text" name="name" class="text"/>

			 <label for="tel">电话：</label>
			 <input type="text" name="tel" class="text"/>
		 </div>
		 <hr />
		 <p>
		 <h3>总价格范围</h3>
		 <label for="sum_price_from">从</label>
		 <input type="text" id="sum_price_from" name="sum_price_from" class="text"/><br />
		 <label for="sum_price_to">到</label>
		 <input type="text" id="sum_price_to" name="sum_price_to" class="text"/>
		 </p>
		 <hr />
		 <p>
		 <h3>购买数量范围</h3>
		 <label for="quantity_from">从</label>
		 <input type="text" id="quantity_from" name="quantity_from" class="text"/><br />
		 <label for="quantity_to">到</label>
		 <input type="text" id="quantity_to" name="quantity_to" class="text"/>
		 </p>
		 </p>
	 </div>
	 <p>
	 	 <span id="search_button">查询</span>
	 </p>
	 </form>
</div>
<script src="/js/libs/jquery_plugins/location/location.js"></script>
<script src="/js/libs/jquery_plugins/location/area.js"></script>
<script type="text/javascript">
$(function(){
	var dates = $( "#from, #to" ).datepicker({
		altFormat: 'yy-mm-dd',
		defaultDate: "+1w",
		changeMonth: true,
		numberOfMonths: 1,
		onSelect: function( selectedDate ){
			var option = this.id == "from" ? "minDate" : "maxDate",
				instance = $( this ).data( "datepicker" ),
				date = $.datepicker.parseDate(
					instance.settings.dateFormat ||
					$.datepicker._defaults.dateFormat,
					selectedDate, instance.settings );
			dates.not( this ).datepicker( "option", option, date );
		}
	});
	//使能搜索按钮
	$( '#search_button' ).button();
	$( '#search_button').click( function(){
		 $( '#order_search_form' ).submit();
	});
	//order_cond 选中 address 的时候显示
	//地址选择器
	$( '#order_cond' ).change( function(){
		 var this_el = $( this );
		 if( this_el.val() == 'address' ){
			 showLocation();
			 $( '.address_value' ).show();
			 $( '#order_cond_value' ).hide();
		 }else{
			 //清空 address 字表单中的所有input的值
			 $( '.address_value' ).find( 'input' ).each( function( index ,el ){
				 $( el ).val( '' );
			 });
			 $( '.address_value' ).hide();
			 $( '#order_cond_value' ).show();
		 }
	});
});
</script>

